package entity;

import Tools.Tool;

import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;

public class Basket extends Tool {
    public int x,y,height,widht;

    public Image image=baskedImg;
    public Image imageBg=bgImg;
    public Basket(){
        this.x=0;
        this.y=-image.getHeight(null);
        this.widht=150;
        this.height=150;
    }

    public void paintSelf(Graphics g){
        g.drawImage(this.image,this.x+30,850,widht,height,null);
    }

    public void move(KeyEvent e){
      if(e.getKeyCode()==39 && this.x+10<bgImg.getWidth(null)-widht-30){this.x+=10;}
      if(e.getKeyCode()==37 && this.x-10>20){this.x-=10;}
    }
}
